
function new_task(item) {
	var new_dom_id = unique_dom_id++;
	var htmlstr = '<div  data-taskid="' + item.id + '" ';
	htmlstr += ' class="task child_fold " id="' + new_dom_id + '"';
	htmlstr = htmlstr
		+ ' data-sort="' + item.sort + '"'
		+ ' data-stage="' + item.stage + '"'
		+ ' data-archive="' + item.archive + '"'
		+ ' data-getway="' + item.getway + '"'
		+ ' data-intags="' + item.intags + '"'
		+ ' data-tags="' + item.tags + '"';
	htmlstr += '>';
	//   htmlstr+='<div >';
	//	console.log(htmlstr);
	htmlstr += new_task_header(item) + '</div>';
	return htmlstr;
}

function new_task_header(item) {
	var htmlstr = '';

	//	+'<i  class="fa '+node_type_icon[item.nodetype]+'"></i>'	
	//	htmlstr+='<span class="task_title task_for_drag bounceIn animated">'+item.title+'</span>';
	htmlstr += '<div class="task_header">';
	htmlstr += '<a class="icon_fold" href="###" ><i  class="fa"></i></a>';
	htmlstr += '<span class="task_title task_for_drag">' + item.title + '</span>';
	htmlstr += '<span class="iconbar">'
	htmlstr += '<a class="icon_fold" href="###" ><i  class="fa"></i></a>';
	// htmlstr+='<a class="expend_fold" href="###" ><i  class="fa fa-circle"></i></a>';
	//	htmlstr+='<span class="task_stage"><i  class="fa '+stage_icon[item.stage]+'"></i></span>';//使用font-awesome的字体图标
	htmlstr += '<a class="stage_icon"><i></i></a>';//使用样式表图形文件图标
	//	htmlstr+='<img class="stage_icon" src="'+stage_svg_icon[item.stage]+'" >';//使用图标数组

	if (item.internal_link > 0) {
		htmlstr = htmlstr + '<a class="task_internal_link" href="###" data-internal_link="' + item.internal_link + '" title="关联到其它任务"><i class="fa fa-share-square" onclick="position_task_id(' + item.internal_link + ')"></i></a>';
	} else {
		htmlstr += '<a class="task_internal_link"></a>';
	}

	if (item.link) {
		let r = item.link.match(/http[s]?\:\/\/([^\/]*)/);
		//		console.log(r); 
		if (r) {
			//			console.log(r[0]);
			htmlstr = htmlstr + '<a class="task_link" href="' + item.link + '" target="_blank" title="外链" ><img  class="fa fa-link" src="' + r[0] + '/favicon.ico' + '" onerror="this.src=\'/_assets/icons/link.svg\';"></a>';
		} else {
			htmlstr = htmlstr + '<a class="task_link" href="' + item.link + '" target="_blank" title="外链"><i class="fa fa-link"></i></a>';
		}
	} else {
		htmlstr += '<a class="task_link"></a>';
	}
	if (item.comment) {
		htmlstr = htmlstr + '<a class="task_comment_icon" href="###"  title="备注"><i class="fa fa-comment"></i></a>';
	} else {
		htmlstr += '<a class="task_comment_icon"></a>';
		item.comment = '';
	}
	if (item.photo) {
		htmlstr = htmlstr + '<a class="task_photo_icon" href="###" title="图片" data-url="' + item.photo + '"><i class="fa fa-photo"></i></a>';
	} else {
		htmlstr += '<a class="task_photo_icon"></a>';
	}
	htmlstr += '<a class="magic_icon"><i class="fa"></i></a>';
	htmlstr += '</span>';
	htmlstr += '</div>';

	//	htmlstr+='<a class="icon_button btn_for_toolbar"  href="###"  title="操作面板'+item.id+'"><i  class="fa fa-lg fa-angle-double-right"></i></a>';

	//	htmlstr+='<div class="task_photo rotateIn animated " ><img src='+item.photo+' style="max-width:100%"></div>';
	htmlstr += '<div class="task_photo" ><img src=' + item.photo + ' style="max-width:100%"></div>';
	htmlstr += '<div class="task_comment " >' + html_encode(item.comment) + '</div>';

	return htmlstr;
}